-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plans (Storage): Enable storage selection for current plan, and other fixes/refactors #91050
Plans (Storage): Enable storage selection for current plan, and other fixes/refactors #91050
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~340 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~440 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
@jeyip @southp can we please give this a thorough round of testing to see if it's heading in the right direction? Lots more refactors can come on top, but if the functionality is improved, then we may consider merging some version. One possible venue (depending on what we decide in the |
Thanks for working on this, @chriskmnds . People say that one stone two birds is good, we've got 4 birds(bugs) here :D
Sounds good to me. To close the loop here, I've left similar sentiment here: #90949 (comment).
There is a related issue here: #86154, just that the behavior seems to have changed at some points. Given the cited new design spotlight design above, showing a combined price makes the most sense to me. update: @vinimotaa could you help share your insights here with us? I'd be grateful :) |
Hmm, wait. one more case I recalled is to toggle to the longer term when we have purchased a storage add-on: CleanShot.2024-05-24.at.18.40.03.mp4In this case, the total storage is incorrectly resetted to 50G. However, what's more problematic is that I don't really know how we can ever combine the price in the reasonable way since the storage add-ons are only available in the annual term :/ @niranjan-uma-shankar also once raised that here: Automattic/martech#2614. For the time being, maybe showing them as a separate price, e.g. something like "+x / month, billed annually" along side the storage volume label. It's not pretty, but at least it conveys correct info. @vinimotaa @chriskmnds what do you think? 🤔 |
@southp I'm definitely on board with that, for the time being. It's also a little weird to be showing the updated prices only for the "storage-upgradable" plans (cause that's kinda the reality - you cannot have more storage on the others, so it may even be more confusing to be updating all the plan prices, as the alternative). such a maze |
Good point @southp. I feel "not resetting it to 50GB" (without additional fixes) would be equally incorrect. You are looking at 2-year price/features comparison, and the storage is technically a 1-year concern. So it either needs be weirdly smart about it (and equally confusing to the user) or clarified down to detail that the "100GB, plus whatever cost" is only for the first year. So something like |
Hi folks! Sorry I missed this on Friday. Going to check out the PR and respond after dinner tonight 🙂 |
Testing out the branch now 👀 |
TestingRequirementsThe code generally looks reasonable to me. I can take a closer look when I'm back on Tuesday if not merged by then. For each of the flows listed below:
Flows:
Browsers
|
I agree with what has been laid out so far between Christos and James.
Yes making a distinction between the cost of the add-on and the cost of the plan for spotlight plans makes a lot of sense to me, especially if it aligns with future designs.
The concern to me is the user mistakenly believing that they have to pay $x more for the plan because of their add-on. Not sure if this is the best way to handle things, but I wonder if we could also this update the storage label in this case. Something denoting that the upgraded storage would be carried over to their new plan |
FEATURE_13GB_STORAGE, | ||
FEATURE_50GB_STORAGE, | ||
FEATURE_200GB_STORAGE, | ||
FEATURE_50GB_STORAGE_ADD_ON, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB:
It's unfortunate that my initial technical implementation of add-ons relying on feature slugs is spreading a bit more 😕
In the past, we've talked about FEATURE_50GB_STORAGE_ADD_ON
and FEATURE_100GB_STORAGE_ADD_ON
being a misnomer. The add-on is not a feature, and at the very least, it should just be 50GB_STORAGE_ADD_ON
. I know there's a lot more to refactor beyond that, but since we're starting to taking a closer look at this part of the code again, let me know if you think renaming might help with any confusion. I'm happy to set up a PR if we'd like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thinking @jeyip
Let's come back to this later and figure out the best way forward. I'm wondering if we can skip a "meaningful" slug for this altogether and just go with how storage add-ons work (a combination of PRODUCT_1GB_SPACE
& quantity
). So in a way finding a solution that won't need to enumerate/define the options via slugs. Then for the state store we could just store the index of the item selected, not the slug (and whether add-on).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unfortunate that my initial technical implementation of add-ons relying on feature slugs is spreading a bit more 😕
Not at all! I can only feel sympathetic seeing the complexity around this. The problem is deep, and we also didn't exactly have time to "breathe" at the time. 😎
I finally got some other time sensitive work off my plate p1717030570883619/1715880961.253219-slack-C06QNEKS4NN :D Going to take a cloesr look at this PR tonight after dinner |
{ getStorageStringFromFeature( defaultStorageOption?.slug || '' ) } | ||
</StorageButton> | ||
) } | ||
{ storageJSX } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the nested conditionals more readable 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doing a lot more of this in #91196 and likely others on top
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After taking a closer look at the PR, everything seems reasonable so far, and I don't have any concerns with the direction the code is going. I also appreciate the general improvements to readability along the way.
I see that recent changes were pushed with regards to storage label pricing. I will test these updates first thing in the morning 🙂
9196728
to
0796e33
Compare
04c291d
to
7a96eea
Compare
@jeyip Rebased and updated. So it should be all ready now (we did some refactors to storage-options component in trunk). worth double-checking the mobile views. I'm done with this for today - will carry on tomorrow 😅 |
/** | ||
* TODO: Don't do this here. Diverge and show the version with the green pricing next | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine now. we may come back to this component later
planSlug: PlanSlug; | ||
} | ||
|
||
const ELIGIBLE_PLANS_FOR_STORAGE_UPGRADE = [ PLAN_BUSINESS, PLAN_ECOMMERCE ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be revisited and centralized differently. it might actually just be redundant actually
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Rerunning what appear to be flakey E2E specs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests well and behaves as discussed in the PR description -- we can get these changes into production and continue building on work here in follow-up PRs
Thank you again @jeyip ! I will ship this now and move things into follow-ups.
Interesting. Not sure what to do about this now since the price text is already reduced. We could explore a couple of options (switch the view to tablet or otherwise even smaller text 😬 )
Noticed. I'll port this to a new issue and work it out in a follow up. I'm just glad it works at some level right now. More to come! I'll take this up as a bit of a side project to keep improving. |
continuing continuing - make the filtering on site storage across all plan storage options. fix price not upgraded when exceeding - e.g. on enterprise plan with current creator plus 50gb - should filter the option out instead continuing. introducing useStorageStringFromFeature to account for current site storage update storage titles to reflect upgrade from the existing/real site storage disable when any storage upgrade purchased. as before show the actual storage size in the badge.. but TODO added show the actual storage size in the badge.. but TODO added cleanup. move things around into hooks, folders, etc. cleanup
7a96eea
to
c4cc59d
Compare
|
@chriskmnds @jeyip Since there's ongoing work to improve the Storage dropdown presentation, I'm bumping to notice that the storage dropdown is missing on the comparison grid in the offerings experiment |
Fixes #90905 (start of the pit)
Fixes #90947
Fixes #90949
Fixes #91047
Based on #90989
Proposed Changes
Media
Needs Clarity
The remaining parts (to my mind) that need clarity:
On current plan:
with the 100GB storage shown, should the price be
70.96
and not25
?On upgrade plan (Entrepreneur):
with the 100GB storage shown, should the price be
90.96
and not45
?Why are these changes being made?
Addresses all of #90905, #90947, #90949, #91047
Testing Instructions
/start/plans
and confirm storage selection and rendering works as before/plans/[site]
and confirm the same/plans/[site with extra storage]
storageAddOn.purchased
constraints from the code and reload. The selectors for current and Entrepreneur plans should show selection that reflects what the site would have upgraded to, as outlined in Plans (Storage): Wrong values and broken CTA on upgrade plan in admin when storage previously purchased #91047 (so 150GB and 200GB, instead of 100GB and 150GB)Pre-merge Checklist